Skip to content

test: add regression test for C2879853 POLYGON pad shapes - #369

Open
Koizain wants to merge 1 commit into
tscircuit:mainfrom
Koizain:fix/polygon-pad-support-240-239
Open

test: add regression test for C2879853 POLYGON pad shapes#369
Koizain wants to merge 1 commit into
tscircuit:mainfrom
Koizain:fix/polygon-pad-support-240-239

Conversation

@Koizain

@Koizain Koizain commented Mar 26, 2026

Copy link
Copy Markdown

Closes #240

Problem

Part C2879853 failed to import from JLCPCB with:

Failed to generate package from JLCPCB part: Invalid enum value. Expected 'RECT' | 'ELLIPSE' | 'OVAL', received 'POLYGON'

Root Cause & Fix

Polygon pad support was already added to PadSchema (in lib/schemas/package-detail-shape-schema.ts) and the conversion logic in convertEasyEdaJsonToCircuitJson already handles POLYGONpcb_smtpad with shape: "polygon".

Changes

  • Added tests/assets/C2879853.raweasy.json — raw EasyEDA fixture for the part
  • Added tests/convert-to-soup-tests/c2879853-polygon-pads.test.ts — regression test that:
    • Confirms the part parses without error
    • Verifies polygon pads appear in the circuit JSON output as pcb_smtpad with shape=polygon

Testing

bun test tests/convert-to-soup-tests/c2879853-polygon-pads.test.ts

Result: 1 pass, 0 fail

)

Adds fixture and test to confirm POLYGON pad shapes are converted correctly.
The POLYGON shape was added to the enum in PadSchema, and this test verifies
the end-to-end conversion produces pcb_smtpad elements with shape='polygon'.

Fixes tscircuit#240
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C2879853] Failed to import from JLCPCB

1 participant